home *** CD-ROM | disk | FTP | other *** search
- /*
- * The original copyright owners of the accompanying source code files have
- * agreed to place such code into the public domain. Accordingly, anyone
- * who receives or obtains a copy of such source code is freely entitled to
- * reproduce, use and otherwise exploit such code (including the right to
- * make derivative works), at his/her own risk and expense, without any
- * obligation or liability to the original copyright owners.
- *
- * We would appreciate (but do not require) that the following message be
- * included in any derivative works:
- *
- * "Portions of this program were developed by Peter Broadwell, Rob Myers
- * and Robin Schaufler while working in Silicon Valley."
- *
- * The accompanying source code files and related documentation materials
- * are distributed on an "AS IS" basis, without any warranties or
- * guarantees of any kind. All implied warranties, including the implied
- * warranties of merchantability and of fitness for any particular purpose,
- * are expressly disclaimed.
- */
- #include "gl.h"
- #include "geom.h"
- #include "selectors.h"
- #include "class.h"
- #include "classIds.h"
- #include "mbox.h"
- #include "individual.h"
- #include "behavior.h"
- #include "doers.h"
-
- #include "colors.h"
-
- extern class guppyClass;
- model minnowBody, minnowTail;
-
-
- fcnTable minnowTable[] = {
- EOTABLE,
- };
-
- class minnowClass = {
- &guppyClass,
- minnowTable,
- sizeof(individual),
- MINNOW,
- };
-
- individual minnowTemplate = {
- /* inst */
- &minnowClass, /* myClass pointer */
- NULL, /* classFunctions */
- 0, /* nFunctions */
- /* mailbox */
- NULL, /* subscribers */
- NULL, /* subscribedTo */
- /* individual */
- {0,0,0}, /* position */
- {0,0,0}, /* lastPosition */
- {1,0,0}, /* delta */
- {1,1,1}, /* velocity */
- {1,1,1}, /* avelocity */
- {5,3,0}, /* acceleration */
- 24.0, /* speed */
- {40,30,10}, /* heading */
- {0,0,0}, /* rotation */
- {0,0,0}, /* influence */
- 1.0, /* scale */
- &minnowBody, /* model */
- ORDER, /* flags */
- NULL, /* curVars */
- };
-
- point minnowBodyPoints[] = {
- { 0, 0, 0, }, /* gratuitous vertex 0 */
- { 000, -100, 000, },
- { 200, 000, -300, },
- { 750, 000, -030, },
- { 300, -100, 300, },
- { 300, 100, 300, },
- { 000, 100, 000, },
- { 730, 000, -130, },
- { 710, 000, -100, },
- };
-
- point minnowEyePoints[] = {
- { 0, 0, 0, }, /* gratuitous vertex 0 */
- { -10, 000, 0, },
- { 10, 000, 30, },
- { 10, 000, 60, },
- { -10, 000, 80, },
- { -30, 000, 100, },
- { -70, 000, 100, },
- { -80, 000, 90, },
- { -100, 000, 60, },
- { -100, 000, 30, },
- { -90, 000, 0, },
- { -40, 000, -10, },
- };
-
- point minnowIrisPoints[] = {
- { 0, 0, 0, }, /* gratuitous vertex 0 */
- { -8, 000, 0, },
- { 8, 000, 24, },
- { 8, 000, 48, },
- { -8, 000, 64, },
- { -32, 000, 72, },
- { -56, 000, 56, },
- { -64, 000, 32, },
- { -56, 000, 8, },
- { -32, 000, 0, },
- };
-
- point minnowTailPoints[] = {
- { 0, 0, 0, }, /* gratuitous vertex 0 */
- { 000, 000, 000, },
- { -300, 000, 400, },
- { -300, 000, -550, },
- };
-
- /* null terminated polys, double null at end */
- long minnowBodyVertices[] = {
- 1,2,7,8,3,4,0,
- 6,5,3,8,7,2,0,
- 1,4,5,6,0,
- 1,6,2,0,
- 3,5,4,0,
- 0,
- };
- long minnowLEyeVertices[] = {
- 1,2,3,4,5,6,7,8,9,10,11,0,
- 0,
- };
- long minnowLIrisVertices[] = {
- 1,2,3,4,5,6,7,8,9,0,
- 0,
- };
- long minnowREyeVertices[] = {
- 11,10,9,8,7,6,5,4,3,2,1,0,
- 0,
- };
- long minnowRIrisVertices[] = {
- 9,8,7,6,5,4,3,2,1,0,
- 0,
- };
- long minnowTailVertices[] = {
- 1,2,3,0,
- 1,3,2,0,
- 0,
- };
-
- model minnowTail = {
- NULL, /* next model segment */
- NULL, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- minnowTailPoints, /* point dictionary */
- minnowTailVertices, /* polygon descriptions */
- { -150,0,-75}, /* centroid */
- MINNOWTAIL_COLOR, /* color */
- MINNOWTAIL_TEXTURE, /* texture */
- TRUE, /* outlined */
- { 0,0,0}, /* rotation */
- { 0,0,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 10, /* declasse */
- };
-
- model minnowLIris = {
- NULL, /* next model segment */
- NULL, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- minnowIrisPoints, /* point dictionary */
- minnowLIrisVertices, /* polygon descriptions */
- { -40,0,45}, /* centroid */
- MINNOWIRIS_COLOR, /* color */
- MINNOWIRIS_TEXTURE, /* texture */
- FALSE, /* outlined */
- { 0,0,0}, /* rotation */
- { -15,-10,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 25, /* declasse */
- };
- model minnowLEye = {
- NULL, /* next model segment */
- &minnowLIris, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- minnowEyePoints, /* point dictionary */
- minnowLEyeVertices, /* polygon descriptions */
- { -45,0,45}, /* centroid */
- MINNOWEYE_COLOR, /* color */
- MINNOWEYE_TEXTURE, /* texture */
- FALSE, /* outlined */
- { 0,0,0}, /* rotation */
- { 600,-25,-50}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 30, /* declasse */
- };
- model minnowRIris = {
- NULL, /* next model segment */
- NULL, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- minnowIrisPoints, /* point dictionary */
- minnowRIrisVertices, /* polygon descriptions */
- { -40,0,45}, /* centroid */
- MINNOWIRIS_COLOR, /* color */
- MINNOWIRIS_TEXTURE, /* texture */
- FALSE, /* outlined */
- { 0,0,0}, /* rotation */
- { -15,-10,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 25, /* declasse */
- };
- model minnowREye = {
- &minnowLEye, /* next model segment */
- &minnowRIris, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- minnowEyePoints, /* point dictionary */
- minnowREyeVertices, /* polygon descriptions */
- { -45,0,45}, /* centroid */
- MINNOWEYE_COLOR, /* color */
- MINNOWEYE_TEXTURE, /* texture */
- FALSE, /* outlined */
- { 0,0,0}, /* rotation */
- { 600,25,-50}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 30, /* declasse */
- };
-
- model minnowBody = {
- &minnowTail, /* next model segment */
- &minnowREye, /* child model segments */
- 0, /* geometry compiled yet? */
- 0, /* compiled geometry object Id */
- minnowBodyPoints, /* point dictionary */
- minnowBodyVertices, /* polygon descriptions */
- { -375,0,0}, /* centroid */
- MINNOWBODY_COLOR, /* color */
- MINNOWBODY_TEXTURE, /* texture */
- TRUE, /* outlined */
- { 0,0,0}, /* rotation */
- { 0,0,0}, /* translation */
- { 1.0,1.0,1.0}, /* scale */
- 10, /* declasse */
- };
-